﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

using System.Xml;

namespace PriceWatcher
{
    static class Program
    {
        static public string g_xmlFileName;
        static public XmlDocument g_xmlDoc;
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //UserCode:
            g_xmlFileName = System.IO.Path.GetFullPath(System.Environment.CurrentDirectory);
            g_xmlFileName = System.IO.Path.Combine(g_xmlFileName, @"AllTargets.xml");
            g_xmlDoc = new XmlDocument();
            if (System.IO.File.Exists(g_xmlFileName))
                g_xmlDoc.Load(g_xmlFileName);
            else
            {
                XmlDeclaration dec = g_xmlDoc.CreateXmlDeclaration("1.0", "utf-8", null);
                g_xmlDoc.AppendChild(dec);
                XmlElement root = g_xmlDoc.CreateElement("AllTargets");
                g_xmlDoc.AppendChild(root);
                g_xmlDoc.Save(g_xmlFileName);
            }
            //END UserCode
            Application.Run(new frmMain());
        }
    }
}
